import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

public class java5 {
    public static void main(String[] args) {
        int[] arr1={1,2,3};
        int[] arr2={3,4,5,2};
        Map<Integer,Integer> map=new HashMap<>();
        for (int i = 0; i < arr1.length ; i++) {
            int key = arr1[i];
            if (map.containsKey(key)) {
                int n = map.get(key);
                map.put(key, n + 1);
            } else {
                map.put(key, 1);
            }
        }
            for (int j = 0; j < arr2.length ; j++) {
                int key2 = arr2[j];
                if (map.containsKey(key2)) {
                    int n = map.get(key2);
                    map.put(key2, n + 1);
                } else {
                    map.put(key2, 1);
                }
                System.out.println(map);
        }
        ArrayList<Integer> arr3=new ArrayList<>();
            for (Map.Entry<Integer,Integer>entry: map.entrySet()){
                if(entry.getValue()==1){
                    arr3.add(entry.getKey());
                }
            }
        System.out.println(arr3);
    }
}

